Content prefetch sample


XAML, HTML5, Windows Runtime
Data
Windows RT
en-US
4/2/2014

Demonstrates how to use the ContentPrefetcher to add or clear direct content Uniform Resource Identifiers (URIs) or indirect content URIs. It also shows how to get the last successful prefetch time.

To force the operating system to perform a prefetch of these contents in a developer scenario for testing, a desktop application must use the IContentPrefetcherTaskTrigger's TriggerContentPrefetcherTask method to trigger an immediate prefetch operation.

The sample demonstrates these tasks:

  1. Add a direct content URI

    This scenario shows how to add direct content URIs to the ContentUris property for content prefetching or to clear all direct content URIs.

  2. Set an indirect content URI

    This scenario shows how to use the IndirectContentUri property to add indirect content URIs for content prefetching or to clear the indirect content URI.

  3. Get the last prefectch time

    This scenario shows how to use the LastSuccessfulPrefetchTime property to get the last prefetch time.

To obtain an evaluation copy of Windows 8.1, go to Windows 8.1.

To obtain evaluation copies of Microsoft Visual Studio 2013 and Microsoft Visual Studio 2013 Update 2, go to Visual Studio 2013.

Note  For Windows 8 app samples, download the Windows 8 app samples pack. The samples in the Windows 8 app samples pack will build and run only on Microsoft Visual Studio 2012.

Operating system requirements

Client
Windows 8.1
Server
Windows Server 2012 R2

Build the sample

  1. Start Visual Studio 2013 Update 2 and select File > Open > Project/Solution.
  2. Go to the directory in which you unzipped the sample. Go to the directory named for the sample, and double-click the Visual Studio 2013 Solution (.sln) file.
  3. Press Ctrl+Shift+B or use Build > Build Solution to build the sample.

Run the sample

To debug the app and then run it, press F5 or use Debug > Start Debugging. To run the app without debugging, press Ctrl+F5 or use Debug > Start Without Debugging.